using System;
using System.Data.Entity.ModelConfiguration;
using System.Data.Common;
using System.Data.Entity;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using DomainLayer.Data.Entities;

namespace Infrastructure.Data.Mapping
{
	public class WaybillTruckMap : EntityTypeConfiguration<WaybillTruck>
	{
		public WaybillTruckMap()
		{
			// Primary Key
			this.HasKey(t => t.WaybillNOGpsID);

			// Properties
			this.Property(t => t.TruckNO)
				.HasMaxLength(20);
				
			this.Property(t => t.GpsID)
				.HasMaxLength(50);
				
			// Table & Column Mappings
			this.ToTable("WaybillTruck");
			this.Property(t => t.WaybillNOGpsID).HasColumnName("WaybillNOGpsID");
			this.Property(t => t.WaybillNO).HasColumnName("WaybillNO");
			this.Property(t => t.BatchNo).HasColumnName("BatchNo");
			this.Property(t => t.TruckNO).HasColumnName("TruckNO");
			this.Property(t => t.GpsID).HasColumnName("GpsID");
			this.Property(t => t.CreateTime).HasColumnName("CreateTime");
			this.Property(t => t.CreateBy).HasColumnName("CreateBy");
			this.Property(t => t.UpdateTime).HasColumnName("UpdateTime");
			this.Property(t => t.UpdateBy).HasColumnName("UpdateBy");
			this.Property(t => t.IsDelete).HasColumnName("IsDelete");
			this.Property(t => t.DriverID).HasColumnName("DriverID");
		}
	}
}

